﻿function TopNavViewModel() {
    var self = this;

    self.TopNavHome = function () {
        
        jQuery.ajax({
            url: "./Application/ApplicationGrid/",
            type: 'Get',
            contentType: 'html',
            success: function (result) {
                $('#Main').html(result);
                
            }
        });
        
    };

    self.TopNavReset = function () {

        jQuery.ajax({
            url: "./Account/ApplicationGrid/",
            type: 'Get',
            contentType: 'html',
            success: function (result) {
                $('#Main').html(result);
            }
        });

    };

    self.TopNavRegisters = function () {

        jQuery.ajax({
            url: "./Account/Register/",
            type: 'Get',
            contentType: 'html',
            success: function (result) {
                $('#Main').html(result);
            }
        });
        
    };

    self.TopNavLogin = function () {              
        
        jQuery.ajax({
            url: "./Account/Login/",
            type: 'Get',
            contentType: 'html',
            success: function (result) {
                $('#Main').html(result);
            }
        });
        
    };

    self.TopNavApplication = function () {
        
        jQuery.ajax({
            url: "./Application/ApplicationGrid/",
            type: 'Get',
            contentType: 'html',
            success: function (result) {
                $('#Main').html(result);
                
            }
        });
    };

    self.TopNavCreateRole = function () {
        jQuery.ajax({
            url: "./ApplicationRoles/ApplicationRolesGrid/",
            type: 'Get',
            contentType: 'html',
            success: function (result) {
                $('#Main').html(result);

            }
        });       
    };

    self.TopNavUser = function () {
        jQuery.ajax({
            url: "./UserProfile/UserProfileGrid/",
            type: 'Get',
            contentType: 'html',
            success: function (result) {
                $('#Main').html(result);
            }
        });
    };

    self.TopNavRoles = function () {
        jQuery.ajax({
            url: "./UsersInRoles/UsersInRolesGrid/",
            type: 'Get',
            contentType: 'html',
            success: function (result) {
                $('#Main').html(result);
            }
        });
    };

    self.TopNavLogging = function () {
        
        jQuery.ajax({
            url: "./Log/LogGrid/",
            type: 'Get',
            contentType: 'html',
            success: function (result) {
                
                $('#Main').html(result);
            }
        });
    };

    self.TopNavLogcategory = function () {
        jQuery.ajax({
            url: "./LogCategory/LogCategoryGrid/",
            type: 'Get',
            contentType: 'html',
            success: function (result) {
                $('#Main').html(result);
            }
        });
    };

    self.TopNavManage = function () {
        jQuery.ajax({
            url: './account/manage/',
            type: 'Get',
            contentType: 'html',
            success: function (result) {
                $('#Main').html(result);
            }
        });       
    };
    self.TopNavLogout = function () {
        jQuery.ajax({
            url: './account/LogOff/',
            type: 'Post',
            contentType: 'html',
            success: function (result) {
                location.href = "./";
            }
        });
    };

    self.TopNavAppUsers = function () {
        jQuery.ajax({
            url: './ApplicationUser/ApplicationUserGrid/',
            type: 'get',
            contentType: 'html',
            success: function (result) {
                $('#Main').html(result);
            }
        });
    };

    self.LeftNavProfile = function () {
        jQuery.ajax({
            url: './Home/profile/',
            type: 'get',
            contentType: 'html',
            success: function (result) {
                $('#Main').html(result);
            }
        });
    };

    self.LeftNavSettings = function () {
        jQuery.ajax({
            url: './Home/Settings/',
            type: 'get',
            contentType: 'html',
            success: function (result) {
                $('#Main').html(result);
            }
        });
    };

    self.LeftNavHelp = function () {
        jQuery.ajax({
            url: './Home/Help/',
            type: 'get',
            contentType: 'html',
            success: function (result) {
                $('#Main').html(result);
            }
        });
    };   
}; //End of view model





